package com.yww.algorithm.recursion.fibonacci;

/**
 * @author yww
 * @description 兔子问题，递归
 * @since 2024/1/31 14:52
 */
public class RabbitQuestion {
    // 计算第n个月的兔子数量
    public static int cal(int n) {
        if (n == 0) {
            return 0;
        }
        if (n < 3) {
            return 1;
        }
        return cal(n - 1) + cal(n - 2);
    }

    public static void main(String[] args) {
        System.out.println(cal(6));
    }
}
